﻿using Mimi.Models.DataModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Mimi.Common
{
    public interface IStorageManager
    {
        /// <summary>
        /// Create local database to store app data
        /// </summary>
        void CreateStorageDatabase();

        /// <summary>
        /// Create budget table
        /// </summary>
        void CreateBudgetTable(IEnumerable<string> propertyList);

        /// <summary>
        /// Create expense table
        /// </summary>
        void CreateExpenseTable(IEnumerable<string> propertyList);

        /// <summary>
        /// Create overview table
        /// </summary>
        /// <param name="propertyList"></param>
        void CreateOverviewTable(IEnumerable<string> propertyList);

        /// <summary>
        /// Create income table
        /// </summary>
        /// <param name="propertyList"></param>
        void CreateIncomeTable(IEnumerable<string> propertyList);

        /// <summary>
        /// Add new record to Expense table
        /// </summary>
        /// <param name="expense"></param>
        void AddExpenseData(Expense expense);

        /// <summary>
        /// Add new record to Budget table
        /// </summary>
        /// <param name="purpose"></param>
        void AddBudgetData(Purpose purpose);

        /// <summary>
        /// Add new record to Income table
        /// </summary>
        /// <param name="income"></param>
        void AddIncomeData(Income income);

        /// <summary>
        /// Query all data from budget table
        /// </summary>
        Task<IEnumerable<Purpose>> QueryAllBudgetData();

        /// <summary>
        /// Query all data from expense table
        /// </summary>
        /// <returns></returns>
        Task<IEnumerable<Expense>> QueryAllExpenseData();

        /// <summary>
        /// Update row data on budget table
        /// </summary>
        /// <param name="purpose"></param>
        void UpdateBudgetRowData(Purpose purpose);

        /// <summary>
        /// Add new record to overview table
        /// </summary>
        /// <param name="overview"></param>
        void AddOverviewData(Overview overview);

        /// <summary>
        /// Update record data in overview table
        /// </summary>
        /// <param name="overview"></param>
        void UpdateOverviewRowData(Overview overview);

        /// <summary>
        /// Query overview data
        /// </summary>
        /// <returns></returns>
        Overview QueryOverviewData();

        /// <summary>
        /// Query income data
        /// </summary>
        /// <returns></returns>
        Task<IEnumerable<Income>> QueryIncomeData();

        /// <summary>
        /// Remove a record from Income table
        /// </summary>
        /// <param name="income"></param>
        void RemoveFromIncomeTable(Income income);
    }
}
